A secure way to enable communication between two windows (or tabs) that belong to different origins (domains). Can pass JSON data oneway between origin1 and origin2
<!DOCTYPEhtml><html><head><title>Child Window</title></head><body><buttononclick="sendMessage()">Send Message to Parent</button><script>functionsendMessage(){constmessage='Hello from Child Window!';parent.postMessage(message, 'https://origin1.com');}</script></body></html>